<%@include file="/WEB-INF/includes/taglibs.jsp"%>
<table class="content">
	<tr>
		<td>
			<spring:url value="/accounts" var="form_url"/>
			<form:form action="${form_url}" method="POST" modelAttribute="account">
			<table width="200">
				<tr>
					<th colspan="2">
						<c:choose>
			    			<c:when test="${account.id == 0}">
			    				Create Account
			    			</c:when>
			    			<c:otherwise>
			    				Update Account
			    			</c:otherwise>
			    		</c:choose>
			    	</th>
				</tr>				
			    <c:if test="${not empty errors}">
				    <tr>    
				    	<td colspan="2">
				        	<form:errors cssClass="errors" delimiter="&lt;p/&gt;"/>
				        </td>
					</tr>
				</c:if>
				<tr>
					<td>
						<label for="_name_id">Name:</label>
					</td>
					<td>
						<form:input id="_name_id" maxlength="30" path="name" size="0"/>
						<br/>
						<form:errors cssClass="errors" id="_name_error_id" path="name"/>
					</td>
				</tr>
				<tr>
					<td>
						<label for="_balance_id">Balance:</label>
					</td>
					<td>						
			            <form:input cssStyle="width:250px" id="_balance_id" maxlength="30" path="balance" size="0"/>
			            <br/>
			            <form:errors cssClass="errors" id="_balance_error_id" path="balance"/>
					</td>
				</tr>
			    <tr>
			    	<td colspan="2" align="right">   
			    		<form:hidden path="id" /> 
			    		<c:choose>
			    			<c:when test="${account.id == 0}">
			    				<input type="submit" value="Create Account"/>
			    			</c:when>
			    			<c:otherwise>
			    				<input type="submit" value="Update Account"/>
			    			</c:otherwise>
			    		</c:choose>    
					</td>        
			    </tr>			    
			</table>
			</form:form>
		</td>
	</tr>    
</table>